<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p>1</p>
    <p>1</p>
    <p>2</p>
    <script>
        //arguments
        //     function func() {
        //         const [a, b] = arguments;
        //         console.log(a, b); //1 2
        //     }
        //     func(1, 2)


        //NodeList
        //  console.log(document.querySelectorAll('p'));
        //  const [p1, p2, p3] = document.querySelectorAll('p');
        //  console.log(p1, p2, p3);

        //函数参数的结构赋值
        //  const array = [1, 2];
        //  const add = ([x, y]) => x + y;
        //  console.log(add(array)); //3
        //交换变量的值
        let x = 1;
        let y = 2;
        [x, y] = [y, x];
        console.log(x, y); //2 1
    </script>
</body>

</html>